package org.jeecg.modules.ws.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.jeecg.modules.ws.entity.WsBankForewarn;
import org.jeecg.modules.ws.mapper.WsBankForewarnMapper;
import org.jeecg.modules.ws.service.IWsBankForewarnService;
import org.jeecg.modules.ws.vo.BankForewarnVo;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.Collections;
import java.util.List;

/**
 * @Description: 银行账户预警
 * @Author: jeecg-boot
 * @Date:   2025-04-08
 * @Version: V1.0
 */
@Service
public class WsBankForewarnServiceImpl extends ServiceImpl<WsBankForewarnMapper, WsBankForewarn> implements IWsBankForewarnService {

    @Override
    public List<BankForewarnVo> getForewarnList() {
        return baseMapper.getForewarnList();
    }

    @Override
    public WsBankForewarn getByBankNo(String bankNo) {
        LambdaQueryWrapper<WsBankForewarn> query = Wrappers.lambdaQuery(WsBankForewarn.class);
        query.eq(WsBankForewarn::getBankNo, bankNo).eq(WsBankForewarn::getDelFlag, "0");
        return getOne(query);
    }
}
